
package com.zkmonitor.common;

public enum Action {
    ADD(10, "add"),

    DELETE(20, "delete"),

    UPDATE(30, "update");

    private int value;
    private String description;

    Action(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public static Action get(int value) {
        for (Action action : Action.values()) {
            if (action.getValue() == value) {
                return action;
            }
        }
        return null;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

}
